
const { DataTypes } = require('sequelize')

const seq = require('../db/seq.js')
const { comment } = require('NeteaseCloudMusicApi')

const UserLike = seq.define('user_like', ({
    id: {
        type: DataTypes.BIGINT,
        allowNull: false,
        primaryKey: true,
        comment: '歌曲ID'
    },
    Songname: {
        type: DataTypes.STRING,
        allowNull: false,
        comment: "歌曲名称"
    },
    imgUrl: {
        type: DataTypes.STRING,
        allowNull: false,
        comment: "歌曲图片"
    },
    artist: {
        type: DataTypes.STRING,
        allowNull: false,
        comment: "作者姓名"
    },
    artistid: {
        type: DataTypes.BIGINT,
        allowNull: false,
        comment: "歌曲ID"
    },
    album: {
        type: DataTypes.STRING,
        allowNull: false,
        comment: "专辑名称"
    },
    albumid: {
        type: DataTypes.STRING,
        allowNull: false,
        comment: "专辑id"
    },
    dt: {
        type: DataTypes.INTEGER,
        allowNull: false,
        comment: "音乐时长"
    },
    isFavorite: {
        type: DataTypes.INTEGER,
        allowNull: false,
        defaultValue: 1,
        comment: "音乐已经喜欢"
    },
    user_id: { // 确保有定义 user_id 字段
        type: DataTypes.UUID,
        allowNull: false,
    },
}))

// UserLike.sync({ force: true })

module.exports = UserLike